﻿<%@ Page Title="Fares" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Fares.aspx.cs" Inherits="IFD2.Fares" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <link href="Datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>

    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Origin:" meta:resourcekey="Origin"></asp:Label>
                <asp:TextBox ID="txtOriAirport" runat="server" CssClass="form-control input-sm" Width="100%"></asp:TextBox>
                <asp:Label ID="Label2" runat="server" Text="Destination:" meta:resourcekey="Destination"></asp:Label>
                <asp:TextBox ID="txtDesAirport" runat="server" CssClass="form-control input-sm" Width="100%"></asp:TextBox>
                <asp:CheckBox ID="chkQpublic" runat="server" Text="Is Public"  meta:resourcekey="IsPublic" Checked="True" /><br />
                <asp:CheckBox ID="chkQopen" runat="server" Text="Open Flight Products" meta:resourcekey="OpenFlightProducts" /><br />
                <asp:Label ID="Label10" runat="server" Text="Status:" meta:resourcekey="Status"></asp:Label><br />
                <asp:DropDownList ID="lstStatus" runat="server" CssClass="form-control input-sm" style="width:100%">
                    <asp:ListItem Value="E" Text="Editing"  meta:resourcekey="Editing"/>
                    <asp:ListItem Value="S" Text="Submitted"  meta:resourcekey="Submitted"/>
                    <asp:ListItem Value="A" Text="Approved" Selected="True"  meta:resourcekey="Approved"/>
                    <asp:ListItem Value="L" Text="Closed"  meta:resourcekey="Locked"/>
                </asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    
                    <asp:MultiView ID="mvEdit" runat="server" ActiveViewIndex="1">
                        <asp:View ID="vAddFare" runat="server">
                            <div class="table-responsive">
                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:2800px;" class="table-hover"
                                    DataKeyNames="airline,code" DataSourceID="SqlDataSource5" ForeColor="#333333" GridLines="None">
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                            <input name="KEY" type="radio" value='<%# Eval("code")+"|"+Eval("airline")+"|"+Eval("cabin")+"|"+Eval("op_airline") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="code" HeaderText="code" ReadOnly="True" SortExpression="code" meta:resourcekey="code1" HeaderStyle-ForeColor="Yellow" />
                                        <asp:BoundField DataField="seg_total" HeaderText="seg_total" SortExpression="seg_total"  meta:resourcekey="seg_total" HeaderStyle-ForeColor="Yellow" />
                                        <asp:BoundField DataField="currency" HeaderText="currency" SortExpression="currency"  meta:resourcekey="currency1" HeaderStyle-ForeColor="Yellow" />
                                        <%--<asp:BoundField DataField="flt_types" HeaderText="flt_types" SortExpression="flt_types"  meta:resourcekey="flt_types" HeaderStyle-ForeColor="Yellow" />--%>
                                        <%--<asp:BoundField DataField="surcharge_type" HeaderText="surcharge_type" SortExpression="surcharge_type"  meta:resourcekey="surcharge_type" HeaderStyle-ForeColor="Yellow" />--%>
                                        <asp:BoundField DataField="seats_min" HeaderText="seats_min" SortExpression="seats_min"  meta:resourcekey="seats_min" />
                                        <asp:BoundField DataField="op_airline" HeaderText="op_airline" SortExpression="op_airline"  meta:resourcekey="op_airline" />
                                        <asp:BoundField DataField="cabin" HeaderText="cabin" SortExpression="cabin"  meta:resourcekey="cabin1" />
                                        <asp:BoundField DataField="agent_rate" HeaderText="agent_rate" SortExpression="agent_rate"  meta:resourcekey="agent_rate" />
                                        <asp:BoundField DataField="agent_policy" HeaderText="agent_policy" SortExpression="agent_policy"  meta:resourcekey="agent_policy" HtmlEncode="false" />
                                        <asp:BoundField DataField="begin_date" HeaderText="begin_date" SortExpression="begin_date"  meta:resourcekey="begin_date"  DataFormatString="{0:d}"/>
                                        <asp:BoundField DataField="end_date" HeaderText="end_date" SortExpression="end_date"  meta:resourcekey="end_date"  DataFormatString="{0:d}"/>
                                        <asp:BoundField DataField="fltdate_from" HeaderText="fltdate_from" SortExpression="fltdate_from"  meta:resourcekey="fltdate_from"  DataFormatString="{0:d}"/>
                                        <asp:BoundField DataField="fltdate_to" HeaderText="fltdate_to" SortExpression="fltdate_to"  meta:resourcekey="fltdate_to"  DataFormatString="{0:d}"/>
                                        <asp:BoundField DataField="open_advance" HeaderText="open_advance" SortExpression="open_advance"  meta:resourcekey="open_advance" />
                                        <asp:BoundField DataField="close_advance" HeaderText="close_advance" SortExpression="close_advance"  meta:resourcekey="close_advance" />
                                        <asp:BoundField DataField="time_limit" HeaderText="time_limit" SortExpression="time_limit"  meta:resourcekey="time_limit" />
                                        <asp:BoundField DataField="free_baggage" HeaderText="free_baggage" SortExpression="free_baggage"  meta:resourcekey="free_baggage" />
                                        <asp:BoundField DataField="chd_baggage" HeaderText="chd_baggage" SortExpression="chd_baggage"  meta:resourcekey="chd_baggage" />
                                        <asp:BoundField DataField="inf_baggage" HeaderText="inf_baggage" SortExpression="inf_baggage"  meta:resourcekey="inf_baggage" />
                                        <asp:BoundField DataField="refund_rule" HeaderText="refund_rule" SortExpression="refund_rule"  meta:resourcekey="refund_rule" />
                                        <asp:BoundField DataField="status" HeaderText="status" SortExpression="status"  meta:resourcekey="status1" />
                                        <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                        <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                                    </Columns>
                                    <RowStyle BackColor="#EFF3FB" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                            </div>
                            <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                                SelectCommand="bll_fare_get_editing_fares" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                                <SelectParameters>
                                    <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                    <asp:ControlParameter ControlID="chkQpublic" Name="is_public" PropertyName="Checked" Type="Boolean" />
                                    <asp:ControlParameter ControlID="chkQopen" Name="is_open" PropertyName="Checked" Type="Boolean" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <div class="btn-group">
                                <asp:Button ID="btnSegments" runat="server"  CssClass="btn btn-sm btn-default" Text="Segments..." OnClick="btnSegments_Click" meta:resourcekey="Segments" />
                                <asp:Button ID="btnTime" runat="server"  CssClass="btn btn-sm btn-default" Text="Time Frame..." meta:resourcekey="Time" OnClick="btnTime_Click" />
                                <asp:Button ID="butRulesText" runat="server"  CssClass="btn btn-sm btn-default" Text="Rules..." OnClick="butRulesText_Click"  meta:resourcekey="Rules" />
                                <asp:Button ID="butAirlines" runat="server"  CssClass="btn btn-sm btn-default" Text="Airlines...X" OnClick="butAirlines_Click"  meta:resourcekey="Airlines" Enabled="False" Visible="False" />
                                <asp:Button ID="butOffices" runat="server"  CssClass="btn btn-sm btn-default" OnClick="butOffices_Click" Text="Offices..."  meta:resourcekey="Offices" />
                                <asp:Button ID="butFlights" runat="server"  CssClass="btn btn-sm btn-default" Text="Flights..." OnClick="butFlights_Click" Visible="False"  meta:resourcekey="Flights" />
                                <asp:Button ID="btnLogs" runat="server"  CssClass="btn btn-sm btn-default" Text="Logs..." OnClick="btnLogs_Click"  meta:resourcekey="Logs" />
                            </div>
                            <div class="btn-group">
                                <asp:Button ID="btnSubmit" runat="server"  CssClass="btn btn-sm btn-default" Text="Submit" OnClick="btnSubmit_Click" meta:resourcekey="Submit" />
                                <asp:Button ID="butDelete" runat="server"  CssClass="btn btn-sm btn-default" Text="Delete" OnClick="butDelete_Click"  meta:resourcekey="Delete" />
                            </div>
                            <div class="well well-sm">
                                <asp:Label ID="Label21" runat="server" Font-Bold="True" Text="Add New Fare" meta:resourcekey="AddNewFare"></asp:Label><br />
                                <div class="form-group">
                                <div class="form-group">
                                    <asp:Label ID="Label7" runat="server" Text="Fare ID:" meta:resourcekey="FareID"></asp:Label>
                                    <asp:TextBox ID="txtFareID" runat="server" MaxLength="25" Width="239px" ></asp:TextBox>
                                </div>
                                <div class="form-group">
                                    <asp:CheckBox ID="chkIsPublic" runat="server" Text="Is Public" meta:resourcekey="IsPublic" Checked="True" />
                                    <asp:CheckBox ID="chkIsOpen" runat="server" Text="Is Open" meta:resourcekey="OpenFlightProducts"/>
                                </div>
                                </div><br class="hidden-xs" />
                                Year/Season/Trip(SegTotal)/Cabin/Class/Discount/xxx...<br /> 
                                Sample: 2 A CAN PEK 2 Y K3 95 XXXXX, 2 B CAN PEK SHE Y B 90 XXXXX<br />
                                <div class="form-group">
                                <asp:Label ID="Label18" runat="server" meta:resourcekey="TotalSeg" Text="Total Seg.:"></asp:Label>
                                <asp:DropDownList ID="lstSegTotal" runat="server">
                                    <asp:ListItem Selected="True">1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                </asp:DropDownList>
                                </div>
                                <div class="form-group">
                                <asp:Label ID="Label5" runat="server" meta:resourcekey="Currency" Text="Currency:"></asp:Label>
                                <asp:DropDownList ID="lstCurrency" runat="server" DataSourceID="sqlCurrency" DataTextField="code" DataValueField="code" Width="122px"></asp:DropDownList>
                                </div>
                                <%--<div class="form-group">
                                <asp:Label ID="Label20" runat="server" Text="Flight Types:" meta:resourcekey="FlightTypes"></asp:Label>
                                <asp:TextBox ID="txtFltTypes" runat="server" MaxLength="5" Width="50px">12345</asp:TextBox>
                                <asp:DropDownList ID="lstFltType" runat="server" Enabled="False" 
                                    Visible="False">
                                    <asp:ListItem Value="*" Selected="True"  meta:resourcekey="All" Text="All"></asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                </asp:DropDownList>
                                </div>--%>
                                <div class="form-group">
                                <%--<asp:Label ID="Label27" runat="server" Text="Surcharge Type: " meta:resourcekey="SurchargeType"></asp:Label>
                                &nbsp;<asp:DropDownList ID="lstSurchargeTypes" runat="server">
                                    <asp:ListItem Selected="True">A</asp:ListItem>
                                    <asp:ListItem>B</asp:ListItem>
                                    <asp:ListItem>C</asp:ListItem>
                                    <asp:ListItem>D</asp:ListItem>
                                    <asp:ListItem>E</asp:ListItem>
                                    <asp:ListItem>F</asp:ListItem>
                                </asp:DropDownList>--%>
                                </div><br class="hidden-xs" />
                                <div class="form-group">
                                <asp:Label ID="Label24" runat="server" meta:resourcekey="EffectDate" Text="Effect Window(UTC):"></asp:Label>
                                <asp:TextBox ID="txtBeginDate" CssClass="form_datetime" runat="server" Width="130px" MaxLength="16"></asp:TextBox>
                                -
                                <asp:TextBox ID="txtEndDate" CssClass="form_datetime" runat="server" Width="130px" MaxLength="16"></asp:TextBox>
                                (YYYY-M-D HH:MM)
                                </div><br class="hidden-xs" />
                                <div class="form-group">
                                <asp:Label ID="Label8" runat="server" Text="Flight date:" meta:resourcekey="Flightdate"></asp:Label>
                                <asp:TextBox ID="txtDateFrom" CssClass="form_date" runat="server" Width="80px" MaxLength="10" ></asp:TextBox>
                                -   
                                <asp:TextBox ID="txtDateTo" CssClass="form_date" runat="server" Width="80px" MaxLength="10"></asp:TextBox>
                                </div>
                                <div class="form-group">
                                <asp:Label ID="Label9" runat="server" Text="Open in advance:" meta:resourcekey="Openinadvance"></asp:Label>
                                -<asp:TextBox ID="txtOpenAdvance" runat="server" Width="50px" MaxLength="4">9999</asp:TextBox>
                                </div>
                                <div class="form-group">
                                <asp:Label ID="Label19" runat="server" Text="Close in advance:" meta:resourcekey="Closeinadvance"></asp:Label>
                                -<asp:TextBox ID="txtCloseAdvance" runat="server" Width="50px" MaxLength="4">0</asp:TextBox>
                                </div>
                                <br class="hidden-xs" />
                                <div class="form-group">
                                <asp:Label ID="Label4" runat="server" Text="Seats Min:" meta:resourcekey="SeatsMin"></asp:Label>
                                <asp:TextBox ID="txtSeatsFloor" runat="server" Width="35px" MaxLength="3">1</asp:TextBox>
                                </div>
                                <div class="form-group">
                                    <asp:Label ID="Label16" runat="server" Text="Time Limit:" meta:resourcekey="TimeLimit"></asp:Label>
                                    <asp:TextBox ID="txtTimeLimit" runat="server" MaxLength="3" Width="35px">30</asp:TextBox>
                                </div>
                                <br class="hidden-xs" />
                                <asp:UpdatePanel ID="UpdatePanel2" runat="server"><ContentTemplate>
                                    <div class="form-group">
                                    <asp:Label ID="Label3" runat="server" Text="Operating Airline:" meta:resourcekey="OperatingAirline" ForeColor="Red"></asp:Label>
                                    <asp:DropDownList ID="lstOpAirline" runat="server" AutoPostBack="True" DataSourceID="sqlOpAirlines"
                                        DataTextField="code" DataValueField="code" 
                                                OnSelectedIndexChanged="lstOpAirline_SelectedIndexChanged" 
                                                ondatabound="lstOpAirline_DataBound">
                                    </asp:DropDownList>
                                    </div>
                                    <div class="form-group">
                                    <asp:Label ID="Label6" runat="server" Text="Cabin:" meta:resourcekey="Cabin"></asp:Label>&nbsp;
                                    <asp:DropDownList
                                        ID="lstCabin" runat="server" DataSourceID="sqlOpCabin"
                                        DataTextField="description" DataValueField="cabin">
                                    </asp:DropDownList>
                                    </div>
                                </ContentTemplate></asp:UpdatePanel>
                                <div class="form-group">
                                <asp:Label ID="Label13" runat="server" Text="Free Bag.: " meta:resourcekey="FreeBag"></asp:Label>
                                <asp:TextBox ID="txtBaggage" runat="server"  Width="135px" MaxLength="20"></asp:TextBox>
                                </div>
                                <div class="form-group">
                                <asp:Label ID="Label11" runat="server" Text="Child Bag.: " meta:resourcekey="ChildBag"></asp:Label>
                                <asp:TextBox ID="txtChdBag" runat="server" Width="135px" MaxLength="20"></asp:TextBox>
                                </div>
                                <div class="form-group">
                                <asp:Label ID="Label12" runat="server" Text="Infant Bag.:" meta:resourcekey="InfantBag"></asp:Label>
                                <asp:TextBox ID="txtInfBag" runat="server" Width="135px" MaxLength="20"></asp:TextBox>
                                </div><br class="hidden-xs" />
                                <div class="form-group">
                                <asp:Label ID="Label22" runat="server" Text="Agent Rate:" meta:resourcekey="AgentRate"></asp:Label>
                                <asp:TextBox ID="txtAgentRate" runat="server" Width="30px">3</asp:TextBox>
                                <asp:Label ID="Label23" runat="server" Text="%"></asp:Label>
                                </div><br class="hidden-xs" />
                                <asp:Label ID="Label14" runat="server" Text="Agent Policy:" meta:resourcekey="AgentPolicy"></asp:Label><br />
                                <asp:TextBox ID="txtAgentPolicy" runat="server" Height="58px" MaxLength="50" TextMode="MultiLine" Width="100%"></asp:TextBox>
                                <br />
                                <asp:UpdatePanel ID="UpdatePanel3" runat="server"><ContentTemplate>
                                    <div class="form-group">
                                    <asp:Label ID="Label26" runat="server" Text="Refund Rule: " meta:resourcekey="RefundRule"></asp:Label>
                                    <asp:DropDownList ID="lstRefundRules" runat="server" 
                                        DataSourceID="sqlRefundRules" DataTextField="rule_code" 
                                        DataValueField="rule_code" AutoPostBack="True" 
                                        onselectedindexchanged="lstRefundRules_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    </div>
                                    <div class="table-responsive">
                                    <asp:GridView ID="grdRefundDetails" runat="server" AutoGenerateColumns="False" 
                                        CellPadding="4" DataKeyNames="airline,rule_code,hours_from_fly" style="min-width:450px;" class="table-hover"
                                        DataSourceID="SqlRefundRuleDetails" ForeColor="#333333" GridLines="None">
                                        <AlternatingRowStyle BackColor="White" />
                                        <Columns>
                                            <asp:BoundField DataField="rule_code" HeaderText="rule_code" ReadOnly="True" Visible="false"
                                                SortExpression="rule_code" meta:resourcekey="rule_code" />
                                            <asp:BoundField DataField="responsibility" HeaderText="responsibility" 
                                                ReadOnly="True" SortExpression="responsibility" meta:resourcekey="responsibility1" HeaderStyle-ForeColor="Yellow" />
                                            <asp:BoundField DataField="hours_from_fly" HeaderText="hours_from_fly" 
                                                ReadOnly="True" SortExpression="hours_from_fly" meta:resourcekey="hours_from_fly" />
                                            <asp:BoundField DataField="refund_rate" HeaderText="refund_rate" 
                                                SortExpression="refund_rate" meta:resourcekey="refund_rate" />
                                            <asp:BoundField DataField="done_user" HeaderText="done_user" 
                                                SortExpression="done_user" meta:resourcekey="done_user" />
                                            <asp:BoundField DataField="done_time" HeaderText="done_time" 
                                                SortExpression="done_time" meta:resourcekey="done_time" />
                                        </Columns>
                                        <EditRowStyle BackColor="#2461BF" />
                                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#EFF3FB" />
                                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                    </asp:GridView>
                                    </div>
                                </ContentTemplate></asp:UpdatePanel>
                                <asp:Button ID="butAdd" runat="server" Text="Add"   CssClass="btn btn-sm btn-default" OnClick="butAdd_Click" meta:resourcekey="Add" />
                                <asp:SqlDataSource ID="sqlCurrency" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                                    SelectCommand="bll_currency_get_codes" SelectCommandType="StoredProcedure" 
                                    DataSourceMode="DataReader">
                                </asp:SqlDataSource>
                                <asp:SqlDataSource ID="sqlOpAirlines" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                                    SelectCommand="bll_airline_get_codes" SelectCommandType="StoredProcedure">
                                </asp:SqlDataSource>
                                <asp:SqlDataSource ID="sqlOpCabin" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                                    SelectCommand="bll_cabin_get_names_by_lang" 
                                    SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="lstOpAirline" Name="airline" PropertyName="SelectedValue" Type="String" />
                                        <asp:SessionParameter Name="lang" SessionField="LANG" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <asp:SqlDataSource ID="sqlRefundRules" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                                    SelectCommand="bll_fare_get_avail_refund_rules" SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <asp:SqlDataSource ID="SqlRefundRuleDetails" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                                    SelectCommand="bll_fare_get_refund_rule_details" SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                        <asp:ControlParameter ControlID="lstRefundRules" Name="rule_code" PropertyName="SelectedValue" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                            </div>
                        </asp:View>

                        <asp:View ID="vOkFares" runat="server">
                            <div class="table-responsive">
                                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"  style="min-width:2800px;" class="table-hover"
                                    DataKeyNames="airline,code" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                            <input name="KEY" type="radio" value='<%# Eval("code")+"|"+Eval("airline")+"|"+Eval("cabin")+"|"+Eval("op_airline") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="code" HeaderText="code" ReadOnly="True" SortExpression="code"  meta:resourcekey="code1" HeaderStyle-ForeColor="Yellow" />
                                        <asp:BoundField DataField="seg_total" HeaderText="seg_total" SortExpression="seg_total"  meta:resourcekey="seg_total" HeaderStyle-ForeColor="Yellow" />
                                        <asp:BoundField DataField="currency" HeaderText="currency" SortExpression="currency"  meta:resourcekey="currency1" HeaderStyle-ForeColor="Yellow" />
                                        <%--<asp:BoundField DataField="flt_types" HeaderText="flt_types" SortExpression="flt_types"  meta:resourcekey="flt_types" HeaderStyle-ForeColor="Yellow" />--%>
                                        <%--<asp:BoundField DataField="surcharge_type" HeaderText="surcharge_type" SortExpression="surcharge_type"  meta:resourcekey="surcharge_type" HeaderStyle-ForeColor="Yellow" />--%>
                                        <asp:BoundField DataField="seats_min" HeaderText="seats_min" SortExpression="seats_min"  meta:resourcekey="seats_min" />
                                        <asp:BoundField DataField="op_airline" HeaderText="op_airline" SortExpression="op_airline"  meta:resourcekey="op_airline" />
                                        <asp:BoundField DataField="cabin" HeaderText="cabin" SortExpression="cabin"  meta:resourcekey="cabin1" />
                                        <asp:BoundField DataField="agent_rate" HeaderText="agent_rate" SortExpression="agent_rate"  meta:resourcekey="agent_rate" />
                                        <asp:BoundField DataField="agent_policy" HeaderText="agent_policy" SortExpression="agent_policy"  meta:resourcekey="agent_policy" HtmlEncode="false" />
                                        <asp:BoundField DataField="begin_date" HeaderText="begin_date" SortExpression="begin_date"  meta:resourcekey="begin_date" DataFormatString="{0:d}" />
                                        <asp:BoundField DataField="end_date" HeaderText="end_date" SortExpression="end_date"  meta:resourcekey="end_date" DataFormatString="{0:d}" />
                                        <asp:BoundField DataField="fltdate_from" HeaderText="fltdate_from" SortExpression="fltdate_from"  meta:resourcekey="fltdate_from" DataFormatString="{0:d}" />
                                        <asp:BoundField DataField="fltdate_to" HeaderText="fltdate_to" SortExpression="fltdate_to"  meta:resourcekey="fltdate_to" DataFormatString="{0:d}" />
                                        <asp:BoundField DataField="open_advance" HeaderText="open_advance" SortExpression="open_advance"  meta:resourcekey="open_advance" />
                                        <asp:BoundField DataField="close_advance" HeaderText="close_advance" SortExpression="close_advance"  meta:resourcekey="close_advance" />
                                        <asp:BoundField DataField="time_limit" HeaderText="time_limit" SortExpression="time_limit"  meta:resourcekey="time_limit" />
                                        <asp:BoundField DataField="free_baggage" HeaderText="free_baggage" SortExpression="free_baggage"  meta:resourcekey="free_baggage" />
                                        <asp:BoundField DataField="chd_baggage" HeaderText="chd_baggage" SortExpression="chd_baggage"  meta:resourcekey="chd_baggage" />
                                        <asp:BoundField DataField="inf_baggage" HeaderText="inf_baggage" SortExpression="inf_baggage"  meta:resourcekey="inf_baggage" />
                                        <asp:BoundField DataField="refund_rule" HeaderText="refund_rule" SortExpression="refund_rule"  meta:resourcekey="refund_rule" />
                                        <asp:BoundField DataField="status" HeaderText="status" SortExpression="status"  meta:resourcekey="status1" />
                                        <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                        <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                                    </Columns>
                                    <RowStyle BackColor="#EFF3FB" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                            </div>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                                DataSourceMode="DataReader" SelectCommand="bll_fare_get_by_segment" SelectCommandType="StoredProcedure">
                                <SelectParameters>
                                    <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                    <asp:ControlParameter ControlID="txtOriAirport" Name="ori_airport" PropertyName="Text" Type="String" />
                                    <asp:ControlParameter ControlID="txtDesAirport" Name="des_airport" PropertyName="Text" Type="String" />
                                    <asp:ControlParameter ControlID="chkQpublic" Name="is_public" PropertyName="Checked" Type="Boolean" />
                                    <asp:ControlParameter ControlID="chkQopen" Name="is_open" PropertyName="Checked" Type="Boolean" />
                                    <asp:ControlParameter ControlID="lstStatus" Name="status" PropertyName="SelectedValue" Type="String" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <div class="btn-group">
                                <asp:Button ID="btnSegments2" runat="server"  CssClass="btn btn-sm btn-default" Text="Segments..." OnClick="btnSegments_Click" meta:resourcekey="Segments" />
                                <asp:Button ID="btnTime2" runat="server"  CssClass="btn btn-sm btn-default" Text="Time..." meta:resourcekey="Time" OnClick="btnTime_Click" />
                                <asp:Button ID="butRulesText2" runat="server"  CssClass="btn btn-sm btn-default" Text="Rules..." OnClick="butRulesText_Click"  meta:resourcekey="Rules" />
                                <asp:Button ID="butAirlines2" runat="server"  CssClass="btn btn-sm btn-default" Text="Airlines...X" OnClick="butAirlines_Click"  meta:resourcekey="Airlines" Enabled="False" Visible="False" />
                                <asp:Button ID="butOffices2" runat="server"  CssClass="btn btn-sm btn-default" OnClick="butOffices_Click" Text="Offices..."  meta:resourcekey="Offices" />
                                <asp:Button ID="butFlights2" runat="server"  CssClass="btn btn-sm btn-default" Text="Flights..." OnClick="butFlights_Click" Visible="False"  meta:resourcekey="Flights" />
                                <asp:Button ID="btnLogs2" runat="server"  CssClass="btn btn-sm btn-default" Text="Logs..." OnClick="btnLogs_Click"  meta:resourcekey="Logs" />
                            </div>
                            <div class="btn-group">
                                <asp:Button ID="btnReject" runat="server"  CssClass="btn btn-sm btn-default" Text="Reject" OnClick="btnReject_Click"  meta:resourcekey="Reject" />
                                <asp:Button ID="butApprove" runat="server"  CssClass="btn btn-sm btn-default" OnClick="butApprove_Click" Text="Approve" meta:resourcekey="Approve" ForeColor="Red" />
                                <asp:Button ID="btnBlock" runat="server"  CssClass="btn btn-sm btn-default" Text="Lock" OnClick="btnBlock_Click" Visible="False"  meta:resourcekey="Lock" />
                            </div><br />
                            <asp:Label ID="lblError2" runat="server" CssClass="ifdMessage"></asp:Label>
                            <div class="well well-sm">
                                <div class="form-group">
                                <asp:Label ID="Label15" runat="server" Text="• Change Open Window(UTC):"  meta:resourcekey="OpenWindow"></asp:Label>
                                <asp:TextBox ID="txtBeginDate2" CssClass="form_datetime" runat="server" Width="130px" MaxLength="16"></asp:TextBox>
                                &nbsp;-
                                <asp:TextBox ID="txtEndDate2" CssClass="form_datetime" runat="server" Width="130px" MaxLength="16"></asp:TextBox>(YYYY-M-D hh:mm)
                                </div>
                                <asp:Button ID="btnReset" runat="server"  CssClass="btn btn-sm btn-default" Text="Reset"  meta:resourcekey="Reset" OnClick="btnReset_Click" />
                            </div>
                            <%--<div class="well well-sm invisible">
                                <asp:Label ID="Label25" runat="server" Text="Copy As New Product(Approved Only):" meta:resourcekey="CopyAsNewFare" Enabled="False"></asp:Label>
                                <asp:TextBox ID="txtNewFareID" runat="server" MaxLength="25" Width="124px" Enabled="False"></asp:TextBox>
                                <asp:Button ID="btnCopyAs" runat="server" onclick="btnCopyAs_Click" meta:resourcekey="CopyAs" Text="Copy As_X" Enabled="False" Width="100px" />
                            </div>--%>
                        </asp:View>
                    </asp:MultiView>
                    
                </div>
            </div>
        </div>
    </div>

    </div>
    </form>

    <script src="Datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.form_datetime').datetimepicker({
                format: 'yyyy-m-d hh:ii',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'month',
                forceParse: 0,
                showMeridian: 0
            });
            $('.form_date').datetimepicker({
                format: 'yyyy-m-d',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'month',
                minView: 'month',
                forceParse: 0
            });
            //$('.form_time').datetimepicker({
            //    format: 'hh:ii',
            //    weekStart: 1,
            //    todayBtn: 1,
            //    autoclose: 1,
            //    todayHighlight: 1,
            //    startView: 'day',
            //    minView: 'hour',
            //    maxView: 'day',
            //    forceParse: 0
            //});

            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
            if ($('#<%=GridView2.ClientID %>').height() > tab_new_height)
                $('#<%=GridView2.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
